import { Connection } from 'mongoose';
import { UserSchema } from './user.schema';
import { DBCONSTANTS } from '../../database/db.constants';

export const userProviders = [
  {
    provide: DBCONSTANTS.userModel,
    useFactory: (connection: Connection) =>
      connection.model('User', UserSchema),
    inject: [DBCONSTANTS.databaseConnection]
  }
];
